package com.cc.moxingvoice.ui.voice;

import android.content.Intent;
import android.databinding.DataBindingUtil;

import com.cc.moxingvoice.R;
import com.cc.moxingvoice.base.BaseActivity;
import com.cc.moxingvoice.databinding.ActivityAddVoicePackageBinding;
import com.cc.moxingvoice.lock.AddVoicePackageLock;
import com.cc.moxingvoice.lock.AppBarLock;

/**
 * 创建日期：2018/3/4 on 10:57
 * 描述：
 * 作者：郭士超
 * QQ：1169380200
 */

public class AddVoicePackageActivity extends BaseActivity {

    private ActivityAddVoicePackageBinding mBinding;
    private AddVoicePackageLock mLock;
    private AppBarLock appBarLock;

    @Override
    protected void initBinding() {
        // 数据绑定操作，可以套用代码
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_add_voice_package);
        mLock = new AddVoicePackageLock(this, mBinding, mBundle);
        mBinding.setLock(mLock);
        appBarLock = new AppBarLock(this, mLock, getString(R.string.add_voice_package),
                R.drawable.back, 0, "", getString(R.string.done), AppBarLock.BACK, AppBarLock.ADD_VOICE_PACKAGE_RIGHT);
        mBinding.appBar.setAppBarLock(appBarLock);
    }

    @Override
    protected void init() {
        if (mBundle != null && mBundle.getBoolean("edit")){
            appBarLock.setTitle(getString(R.string.edit_voice_package));
        }
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        mLock.onActivityResult(requestCode, resultCode, data);
        super.onActivityResult(requestCode, resultCode, data);
    }


}
